<core:WRAP file="pub/layout.html"  placeholder="Content">

<td class="mini" width="100%" valign="top" align="left" >
	<table width="100%" border="0" style="padding-left:15;" cellpadding="0" cellspacing="0">
	<tr>
		<td width="100%">
			<table class="topmenu" border="0"  cellpadding="1" cellspacing="0" width="100%">
			<tr class="topmenu" align="center">
				<td style="padding:5; padding-left:10;"><a href="index.htm" class="whitelink">Home</a></td>
				<td style="padding:5; padding-left:10;"><a href="{$member_faq_url}" class="whitelink">Member FAQ</a></td>
				<td style="padding:5; padding-left:10;"><a href="myprofile/index.htm" class="whitelink">My Profile</a></td>
				<td style="padding:5; padding-left:10;"><a href="logout.htm" class="whitelink">Log out</a></td>
			</tr>
			</table>
		</td>
	</tr>

<script language="Javascript">
// Gets a element by its Id. Used for shorter coding.
function GetE( elementId )
{
	return document.getElementById( elementId )  ;
}

var prices = new Array();
prices[1] = {$price1};
prices[2] = {$price2};
prices[3] = {$price3};
prices[4] = {$price4};

function onTypeChange(mytype) {
	var item_nameE = GetE('item_name');
    var item_numberE = GetE('item_number');
    var a3E = GetE('a3');        // price
    var p3E = GetE('p3');        // period
    var t3E = GetE('t3');        // unit
    var srcE = GetE('src');        // recurring?
    var invoiceE = GetE('invoice');        // invoice

    if ( item_numberE )   item_numberE.value = mytype;
    if ( invoiceE )   invoiceE.value = mytype;
    var price = prices[mytype];
    if ( a3E )   a3E.value = price;

    //alert('Change to '+ price + ' type = ' + mytype);

    if (mytype == 1) {
    	if ( item_nameE ) item_nameE.value = 'Chicago Sport News 3-days long Premium Subscription';
        if ( p3E )   p3E.value = '3';
        if ( t3E )   t3E.value = 'D';
        if ( srcE )  srcE.value = '0';
    } else if  (mytype == 2) {
    	if ( item_nameE ) item_nameE.value = 'Chicago Sport News 7-days long Premium Subscription';
    	if ( p3E )   p3E.value = '7';
    	if ( t3E )   t3E.value = 'D';
    	if ( srcE )  srcE.value = '0';
    } else if  (mytype == 3) {
    	if ( item_nameE ) item_nameE.value = 'Chicago Sport News Monthly recurring Premium Subscription';
    	if ( p3E )   p3E.value = '1';
    	if ( t3E )   t3E.value = 'M';
    	if ( srcE )  srcE.value = '1';
    } else if  (mytype == 4) {
    	if ( item_nameE ) item_nameE.value = 'Chicago Sport News Annual recurring Premium Subscription';
    	if ( p3E )   p3E.value = '1';
    	if ( t3E )   t3E.value = 'Y';
    	if ( srcE )  srcE.value = '1';
    }
}
</script>

	<tr>
		<td><hr size="4" class="login"></td>
	</tr>
	<tr>
		<td><div class="lightblue">SUBSCRIBE - Step 2</div></td>
	</tr>
	<tr>
		<td class="textlogin" style="padding-left:20;">
			Please, select one of the 4 subscription options:
		</td>
	</tr>
	<tr>
		<td>
			<table>
			<tr>
				<td width="250">
					<table>
					<tr>
						<td class="textlogin" style="font-size:13;">
							<input type="radio" value="1" name="price" id="price1" onclick="onTypeChange(this.value);"> 3 days (${$price1})
						</td>
					</tr>
					<tr>
						<td class="textlogin" style="font-size:13;">
							<input type="radio" value="2" name="price" id="price2" onclick="onTypeChange(this.value);"> 7 days (${$price2})
						</td>
					</tr>
					<tr>
						<td class="textlogin" style="font-size:13;">
							<input type="radio" value="3" checked name="price" id="price3" onclick="onTypeChange(this.value);"> Monthly (recurring ${$price3})
						</td>
					</tr>
					<tr>
						<td class="textlogin" style="font-size:13;">
							<input type="radio" value="4" name="price" id="price4" onclick="onTypeChange(this.value);"> 1 year (recurring ${$price4})
						</td>
					</tr>
					</table>
				</td>
				<td>
					<img src="/{$#app_name}/images/info_ico.jpg">
				</td>
				<td class="textlogin">
					- For recurring subscriptions you will be billed at the end of every billing period.<br>
					- After pressing "Subscribe now" button you will be
					brought to the secure PayPal server where you would provide
					all the required information to complete your subscription process.
				</td>
			</tr>
			</table>
		</td>
	</tr>



<core:comment>
<!--
<A HREF="https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_subscr-find&alias={$business}&subscr_id={$subscr_id}">
<IMG SRC="https://www.sandbox.paypal.com/en_US/i/btn/cancel_subscribe_gen.gif" BORDER="0">
</A>   -->
</core:comment>

	<tr>
		<td>
			<form action="{$paypal_url}" method="post">
			<input type="hidden" name="cmd" value="_xclick-subscriptions">
			<input type="hidden" name="currency_code" value="USD">
			<input type="hidden" name="lc" value="US">
			<!--<input type="hidden" name="bn" value="PP-SubscriptionsBF">  -->
			<input type="hidden" name="business" value="{$paypal_email}">
			<input type="hidden" name="item_name" value="Chicago Sport News Montly Premium Subscription">
			<input type="hidden" name="item_number" value="3">
			<input type="hidden" name="image_url" value="{$image_url}">
			<input type="hidden" name="no_shipping" value="1">
			<input type="hidden" name="return" value="{$return_url}">
			<input type="hidden" name="cancel_return" value="{$cancel_url}">
			<input type="hidden" name="notify_url" value="{$ipn_url}">   
			<!--<input type="hidden" name="a1" value="0">
			<input type="hidden" name="p1" value="0">
			<input type="hidden" name="t1" value="D">
			<input type="hidden" name="a2" value="0">
			<input type="hidden" name="p2" value="0">
			<input type="hidden" name="t2" value="D"> -->
			<input type="hidden" name="a3" value="7.95">
			<input type="hidden" name="p3" value="1">
			<input type="hidden" name="t3" value="M">
			<input type="hidden" name="src" value="1">
			<input type="hidden" name="sra" value="1">
			<!--<input type="hidden" name="srt" value="5">  -->
			<input type="hidden" name="no_note" value="1">
			<input type="hidden" name="custom" value="{$user_id}">
			<input type="hidden" name="rm" value="2">
			<input type="hidden" name="first_name" value="{$firstname}">
			<input type="hidden" name="last_name" value="{$lastname}">
			<input type="hidden" name="address1" value="{$address1}">
			<input type="hidden" name="address2" value="{$address2}">
			<input type="hidden" name="city" value="{$city}">
			<input type="hidden" name="state" value="{$state}">
			<input type="hidden" name="zip" value="{$zip}">
			<input type="hidden" name="night_phone_a" value="{$night_phone_a}">
			<input type="hidden" name="night_phone_b" value="{$night_phone_b}">
			<input type="hidden" name="night_phone_c" value="{$night_phone_c}">
			<input type="hidden" name="day_phone_a" value="{$day_phone_a}">
			<input type="hidden" name="day_phone_b" value="{$day_phone_b}">
			<input type="hidden" name="day_phone_c" value="{$day_phone_c}">
			<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/x-click-but20.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
			</form>
		</td>
	</tr>
	<tr>
		<td><hr size="4" class="login"></td>
	</tr>
	</table>
</td>
